<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>

<script src="Source/js/jquery.min.js"></script>
<script>
    var ws = new WebSocket('ws://127.0.0.1');

            ws.onopen = function(){
                ws.send('sadfasdf');
            };

    ws.onmessage = function(evt){
        console.log(evt.data);ws.close();
    };

    ws.onclose = function(evt){
        console.log('WebSocketClosed!');
    };

    ws.onerror = function(evt){
        console.log('WebSocketError!');
    };
</script>
</html>